package com.getword.web.controller;


import com.getword.service.ArticleStatisticsService;
import com.getword.web.model.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.ZoneId;
import java.time.ZonedDateTime;
import java.util.Date;

@RestController
@RequestMapping("/api/article/statistics")
public class ApiArticleStatisticController {
    @Autowired
    private ArticleStatisticsService service;
    // 统计今天发布文章的数量
    @GetMapping("/todayCount")
    public Result todayCount(){
        return service.todayCount();
    }
    // 统计最近7天发布文章的数量
    // {'0':{'2019-6-6':20},...}
    @GetMapping("/sevenDayCount")
    public Result sevenDayCount(){
        return service.sevenDayCount();
    }
}
